package com.itheima.controller;

import com.itheima.domain.PageResult;
import com.itheima.domain.Result;
import com.itheima.domain.pojo.OperateLog;
import com.itheima.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/log")
/**
 * 日志列表查询
 */
public class LogController {
    @Autowired
    private LogService logService;


  @GetMapping("/page")
    public Result page(@RequestParam(defaultValue = "1") Integer Page,@RequestParam(defaultValue = "10") Integer PageSize){
      log.info("分页查询:{}",Page,PageSize);
      PageResult<OperateLog> pageResult= logService.page(Page,PageSize);
      return Result.success(pageResult);


  }
}
